package com.hq.shcrm.controller;

import com.hq.shcrm.pojo.MonthIncome;
import com.hq.shcrm.pojo.TCourseOrder;
import com.hq.shcrm.service.ICourceOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/dataanalysis")
public class DataAnalysisController {

    @Autowired
    ICourceOrderService iCourceOrderService;

    @RequestMapping("/income")
    public String income(){
        return "dataanalysis/income";
    }

    @RequestMapping("/monthincomes")
    @ResponseBody
    public List<MonthIncome> monthIncomes(){
       List<MonthIncome> list =  iCourceOrderService.getMonthIncomes();
       return list;
    }

}
